package com.unicom.priceboard.data.vo;

/**
 * @author Quan
 *
 */
public class PutAdElement {
	private Short tradeId;
	private String key;
	private Short securityNo;

	private String volume;

	private String price;

	private Integer firmNo;

	private Character side;

	private Character board;

	private Integer time;

	private Character flag;

	private String symbol_code;
	
	public String getSymbol_code() {
		return symbol_code;
	}

	public void setSymbol_code(String symbol_code) {
		this.symbol_code = symbol_code;
	}

	/**
	 * @return the board
	 */
	public Character getBoard() {
		return board;
	}

	/**
	 * @param board the board to set
	 */
	public void setBoard(Character board) {
		this.board = board;
	}

	/**
	 * @return the firmNo
	 */
	public Integer getFirmNo() {
		return firmNo;
	}

	/**
	 * @param firmNo the firmNo to set
	 */
	public void setFirmNo(Integer firmNo) {
		this.firmNo = firmNo;
	}

	/**
	 * @return the flag
	 */
	public Character getFlag() {
		return flag;
	}

	/**
	 * @param flag the flag to set
	 */
	public void setFlag(Character flag) {
		this.flag = flag;
	}

	/**
	 * @return the price
	 */
	public String getPrice() {
		return price;
	}

	/**
	 * @param price the price to set
	 */
	public void setPrice(String price) {
		this.price = price;
	}

	/**
	 * @return the securityNo
	 */
	public Short getSecurityNo() {
		return securityNo;
	}

	/**
	 * @param securityNo the securityNo to set
	 */
	public void setSecurityNo(Short securityNo) {
		this.securityNo = securityNo;
	}

	/**
	 * @return the side
	 */
	public Character getSide() {
		return side;
	}

	/**
	 * @param side the side to set
	 */
	public void setSide(Character side) {
		this.side = side;
	}

	/**
	 * @return the time
	 */
	public Integer getTime() {
		return time;
		
	}

	/**
	 * @param time the time to set
	 */
	public void setTime(Integer time) {
		this.time = time;
		this.key=this.tradeId + "-" + this.time;
	}

	/**
	 * @return the tradeId
	 */
	public Short getTradeId() {
		return tradeId;
	}

	/**
	 * @param tradeId the tradeId to set
	 */
	public void setTradeId(Short tradeId) {
		this.tradeId = tradeId;
		
	}

	/**
	 * @return the volume
	 */
	public String getVolume() {
		return volume;
	}

	/**
	 * @param volume the volume to set
	 */
	public void setVolume(String volume) {
		this.volume = volume;
	}

	@Override
	public boolean equals(Object obj) {
		if(!this.getClass().isInstance(obj))
			return false;
		else{
			PutAdElement compareObject = (PutAdElement)obj;
			
			if(this.price!=compareObject.getPrice()){
				return false;
			}else if(this.volume!=compareObject.getVolume()){
				return false;
			}else if(this.time!=compareObject.getTime()){
				return false;
			}	
			return true;
		}
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}
	
	
}
